<!--
 * @Author: your name
 * @Date: 2022-04-02 14:00:58
 * @LastEditTime: 2022-04-02 14:03:02
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \geyao\geyao\常见面试题两栏布局第四种220402.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>两栏布局第四种</title>
  <style>
    .outer {
      position: relative;
      height: 100px;
    }

    .left {
      width: 200px;
      height: 100%;
      background: lightcoral;
    }

    .right {
      position: absolute;
      left: 200px;
      top: 0;
      right: 0;
      bottom: 0;
      height: 100%;
      background: lightseagreen;
    }
  </style>
</head>

<body>
  <div class="outer">
    <div class="left">左侧</div>
    <div class="right">右侧</div>
  </div>
  <!-- 利用绝对定位，父级元素设为相对定位。左边元素宽度固定，右边元素 absolute  定位， left  为宽度大小，其余方向定位为 0  -->
</body>

</html>